/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ShareDeckWindow.java
 *
 * Created on 25/12/2011, 17:57:37
 */
package fallen.deck.front_end;

import fallen.deck.entity.Deck;
import javax.swing.ImageIcon;

/**
 *
 * @author Carlos S. Moreno <CarlosS.Moreno@gmail.com>
 */
public class ShareDeckWindow extends javax.swing.JDialog {

    /** Creates new form ShareDeckWindow */
    public ShareDeckWindow(Deck deck) {
        this.setIconImage(new ImageIcon(getClass().getResource("/icons/16/page_white_code.png")).getImage());        
        initComponents();
        txtPlainText.setText(deck.toPrityString());
        txtForumText.setText(deck.toForumString());
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        tabbedPane = new javax.swing.JTabbedPane();
        pnlPlainText = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        txtPlainText = new javax.swing.JTextArea();
        pnlForumText = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        txtForumText = new javax.swing.JTextArea();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Compartir Mazo");
        setModal(true);

        txtPlainText.setColumns(20);
        txtPlainText.setEditable(false);
        txtPlainText.setRows(5);
        jScrollPane1.setViewportView(txtPlainText);

        javax.swing.GroupLayout pnlPlainTextLayout = new javax.swing.GroupLayout(pnlPlainText);
        pnlPlainText.setLayout(pnlPlainTextLayout);
        pnlPlainTextLayout.setHorizontalGroup(
            pnlPlainTextLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 511, Short.MAX_VALUE)
        );
        pnlPlainTextLayout.setVerticalGroup(
            pnlPlainTextLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 386, Short.MAX_VALUE)
        );

        tabbedPane.addTab("Texto Plano", pnlPlainText);

        txtForumText.setColumns(20);
        txtForumText.setEditable(false);
        txtForumText.setRows(5);
        jScrollPane2.setViewportView(txtForumText);

        javax.swing.GroupLayout pnlForumTextLayout = new javax.swing.GroupLayout(pnlForumText);
        pnlForumText.setLayout(pnlForumTextLayout);
        pnlForumTextLayout.setHorizontalGroup(
            pnlForumTextLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 511, Short.MAX_VALUE)
        );
        pnlForumTextLayout.setVerticalGroup(
            pnlForumTextLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 386, Short.MAX_VALUE)
        );

        tabbedPane.addTab("Texto para Foros", pnlForumText);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 519, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 424, Short.MAX_VALUE)
        );

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-521)/2, (screenSize.height-452)/2, 521, 452);
    }// </editor-fold>//GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JPanel pnlForumText;
    private javax.swing.JPanel pnlPlainText;
    private javax.swing.JTabbedPane tabbedPane;
    private javax.swing.JTextArea txtForumText;
    private javax.swing.JTextArea txtPlainText;
    // End of variables declaration//GEN-END:variables
}
